package controler.userCommands;
import controler.A_State;
import controler.A_UserCommand;
import graphic.RenderObject;

/**
 * @author Damien Mabin
 */

class EditPhysicShape extends A_UserCommand
{

	private var m_RenderObjectToEdit	: RenderObject;
	private var m_Editable				: Bool;
	
	public function new(_NextState:A_State, _RO:RenderObject, _Editable:Bool) 
	{
		super(_NextState);
		m_CanBeUndo = true;
		m_RenderObjectToEdit = _RO;
		m_Editable = _Editable;
	}
	
	override public function DoCommand():Void 
	{
		super.DoCommand();
		A_UserCommand.s_Model.CTRL_SetRenderObjectEditability(m_RenderObjectToEdit, m_Editable);
	}
	
	override public function UndoCommand():Void 
	{
		A_UserCommand.s_Model.CTRL_SetRenderObjectEditability(m_RenderObjectToEdit, !m_Editable);
		super.UndoCommand();
	}
}